﻿using System;
using System.Collections.Generic;
using System.Windows.Forms;

namespace MIDIDrum
{
    static class Program
    {
        /// <summary>
        /// Punto di ingresso principale dell'applicazione.
        /// </summary>
        [STAThread]
        static void Main(string[] args)
        {
            Nini.Util.ArgvParser parser = new Nini.Util.ArgvParser(args);
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Form mainForm;
            if (parser["mode"] == "direct")
                mainForm = new MainForm();
            else
                mainForm = new SplashScreen(false);

            if (parser["input"] == "midi" || parser["input"] == null)
            {
                if (mainForm is SplashScreen)
                {
                    (mainForm as SplashScreen).NextForm = new MainForm();
                } else
                {
                    mainForm = new MainForm();
                }
            }
            else
            {
                if (mainForm is SplashScreen)
                {
                    (mainForm as SplashScreen).NextForm = new NativeInput();
                }
                else
                {
                    mainForm = new NativeInput();
                }
            }

            if (mainForm is SplashScreen)
            {
                (mainForm as SplashScreen).tmrOpacity.Enabled = true;
                (mainForm as SplashScreen).tmrOpacity.Start();
            }
            Application.Run(mainForm);
        }
    }
}
